package com.sss.service;

import com.sss.common.domain.Admin;
import com.sss.dao.AdminDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/*@Component("adminService")*/  // <bean id="AdminServiceImpl"/>
@Service
//@Controller
public class AdminServiceImpl implements AdminService{
    // 服务层注入Dao层
    @Autowired  //可以省略getter 和 setter
    private AdminDao adminDao;  //  用了Spring之后不能new组件  =new AdminDaoImpl;
    @Override
    public Admin getAdminById(Integer id) {
        return adminDao.selectAdminById(id);
    }

    /*public AdminDao getAdminDao() {
        return adminDao;
    }

    public AdminServiceImpl setAdminDao(AdminDao adminDao) {
        this.adminDao = adminDao;
        return this;
    }*/
}
